<%@page language="java" contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="conexao.jsp" %> 

<%  String usuariolog = (String)session.getAttribute("usuario");
	if(usuariolog != null){
%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link  href="css/geral.css" rel="stylesheet" type="text/css" />
        <link rel="shortcut icon" href="favicon.ico" />
    </head>
    <body>
        <div id="tudo">
            
            <div id="cabecalho">
                
            </div>
            
            <div id="menu">
                <jsp:include page="menuprincipal.jsp"></jsp:include>
            </div>
                  
            <div id="principal">
                
                <table border="0" align="center">
                    <tbody>
                        <tr>
                            <input type="hidden" name="ac" value="branco"/>
                            <td><a href="InterfaceManutencao.jsp">Cadastrar Novo Erro</a></td>
                        </tr>
                    </tbody>
                </table>
                <br/>
                <form id="pesquisar" action="listarManutencao2especifico.jsp">    
                    <table  align="center" width=898px>
                        <thead>
                            <tr>
                                <th>
                                    Pesquisar por Tela: <input type="text" name="pesqn"/>
                                </th>
                                <th>
                                    Resolvido<br/>
                                    Sim: <input type="radio" name="radioresolvido" value="sim"/>
                                    Não: <input type="radio" name="radioresolvido" value="nao"/>
                                </th>
                                <th>
                                    <input type="hidden" name="ac" value="pesquisar"/>
                                    <input type="submit" value="Pesquisar"/>
                                </th>
                            </tr>
                        </thead>
                     </table>
                    <br/>
                </form>
                
                <table border="1" align="center" width=898px>
                    <thead>
                        <tr>
                            <th>Id</th>
                            <th>Tela</th>
                            <th>Função</th>
                            <th>Visual</th>
                            <th>Outra</th>
                            <th>Resolvido</th>
                            <th>Editar</th>
                            <th>Visualizar</th>
                            <th>Remover</th>
                        </tr>
                    </thead>
                    <tbody>
<%
    int id;
    String tela;
    String modFuncao;
    String modVisual;
    String modOutras;
    String resolvido;
    
    String pesqn = request.getParameter("pesqn");
    
    String pes = "select * from tbmanutencao order by id";
    
    ResultSet rs = stm.executeQuery(pes);
    while(rs.next()){
        id = rs.getInt("id");
        tela = rs.getString("tela");
        modFuncao = rs.getString("modfuncao");
        modVisual = rs.getString("modvisual");
        modOutras = rs.getString("modoutras");
        resolvido = rs.getString("resolvido");
    
    
%>                  
                    
        
                    <tr>
                        <td><%=id%></td>
                        <td><%=tela%></td>
                        <td><%=modFuncao%></td>
                        <td><%=modVisual%></td>
                        <td><%=modOutras%></td>
                        <td><%=resolvido%></td>
                        <td>
                            <a href="editarManutencao.jsp?id=<%=id%>&tela=<%=tela%>&modfuncao=<%=modFuncao%>&modvisual=<%=modVisual%>&modoutras=<%=modOutras%>&resolvido=<%=resolvido%>">Alterar</a>
                        </td>
                        <td>
                            <a href="listarManutencao.jsp?id=<%=id%>">Visualizar</a>
                        </td>
                        <td>
                            <a href="manterManutencao.jsp?id=<%=id%>&ac=rm">Excluir</a>
                        </td>
                        
                    </tr>
            
<%
    }
    rs.close();
    stm.close();
    con.close();
%>

                    </tbody>
                </table>
                
                
            </div>
        </div>
    </body>
</html>

<% }else{
	request.getRequestDispatcher("index.jsp").forward(request, response);
};%>